<template>
  <div>
    <div>
      <div class="MyMutationsTwo-title">
        <h3>我是MyMutationsTwo组件,我和MyMutations组件是兄弟关系,我将通过vuex的mutations属性获取MyMutations的值</h3>
      </div>
      <div>
        <h4>来自MyMutations组件中输入框的值:</h4>
        <h4 class="MyMutationsTwo-value">{{this.inputValue}}</h4>
      </div>
    </div>
  </div>
</template>

<script>
import store from "../../store";
export default {
  name: "MyMutationsTwo",
  data() {
      return{}
  },
  computed: {
    inputValue() {
      return store.state.inputValue;
    }
  }
};
</script>

<style scoped>
.MyMutationsTwo-value{
    color: red;
}
.MyMutationsTwo-title{
    text-align: center;
}
h3,h4{
    text-align: center;
}
</style>